<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui"
	xmlns:ui="http://java.sun.com/jsf/facelets">

<h:head>
</h:head>
<f:view encoding="ISO-8859-1">

	<h:body>
		<p:ajaxStatus onstart="statusDialog.show();"
			onsuccess="statusDialog.hide();" />
		<p:dialog modal="true" widgetVar="statusDialog" header="Status"
			draggable="false" closable="false">
			<p:graphicImage value="/images/loading.gif" />
		</p:dialog>



		<h:form>
			<p:panel id="panel" header="Adicionar Usuário"
				style="margin-bottom:10px;">
				<p:growl id="growl" showDetail="false" sticky="false" />
				<h:panelGrid columns="2">
					<h:outputLabel for="nome" value="Nome:" />
					<p:inputText id="nome" value="#{usuarioBean.usuario.nome}" required="true" requiredMessage="Campo 'Nome' obrigatório"/>
					 
					
					<h:outputLabel for="sobrenome" value="Sobrenome:" />
					<p:inputText id="sobrenome" value="#{usuarioBean.usuario.sobrenome}"/>
					
					<h:outputLabel for="login" value="Login:" />
					<p:inputText id="login" value="#{usuarioBean.usuario.login}" />
					
					<h:outputLabel for="senha" value="Senha:" />
					<p:inputText id="senha" value="#{usuarioBean.usuario.senha}" />
					
					<h:outputLabel for="data_nascimento" value="Data de nascimento:" />
					<p:calendar id="data_nascimento" value="#{usuarioBean.usuario.data_nascimento}" navigator="true" yearRange="c-100:c+0" display="inline"/> 
					
					
				</h:panelGrid>
			</p:panel>
			<p:commandButton value="Enviar" id="submit" update="panel"	action="#{usuarioBean.inserir}" />
		</h:form>

	</h:body>
</f:view>
</html>